<?php

class Printing extends CActiveRecord
{
	/**
	 * The followings are the available columns in table 'edition_printed':
	 * @var integer $id
	 * @var string $edition_date
	 * @var integer $edition_id
	 * @var integer $project_id
	 * @var integer $meeting_id
	 * @var string $parameters_value
	 * @var string $output_filename
	 */

	/**
	 * Returns the static model of the specified AR class.
	 * @return CActiveRecord the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'edition_printed';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('edition_date, edition_id, project_id, output_filename', 'required'),
			array('edition_id, project_id, meeting_id', 'numerical', 'integerOnly'=>true),
			array('output_filename', 'length', 'max'=>255),
			array('parameters_value', 'safe'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'edition' => array(self::BELONGS_TO, 'Edition', 'edition_id'),
			'project' => array(self::BELONGS_TO, 'Project', 'project_id'),
			'meeting' => array(self::BELONGS_TO, 'Meetings', 'meeting_id'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'Id',
			'edition_date' => 'Edition Date',
			'edition_id' => 'Edition',
			'project_id' => 'Project',
			'meeting_id' => 'Meeting',
			'parameters_value' => 'Parameters Value',
			'output_filename' => 'Output Filename',
		);
	}
}